home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 January / 1986-01.d64 / basic windows (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  29 lines

  1. 100 h=6:w=18:rem height and width of window
  2. 110 r=10:c=10:rem row and column position
  3. 120 dim s(h-1,w-1):rem screen code array
  4. 130 dim b$(h-1),c$(h-1)
  5. 140 b$(0)="[166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]"
  6. 150 b$(1)="[166]deliver messages[166]"
  7. 160 b$(2)="[166]in your programs[166]"
  8. 170 b$(3)="[166]  with windows. [166]"
  9. 180 b$(4)="[166]                [166]"
  10. 190 b$(5)="[166][166][166] f1 to cont.[166][166][166]"
  11. 200 rem *** demonstration - set text color & fill screen with characters
  12. 210 print"[147]";:fori=48to86:a$=a$+chr$(i):next:fori=1to24:printa$:next
  13. 220 rem *** store original screen contents and print window
  14. 230 m=983+40*r+c:rem upper left corner of window
  15. 240 print"[158]":rem set window color
  16. 250 poke214,r-1:print:print"[145]";:rem set row number
  17. 260 fori=0toh-1:forj=0tow-1
  18. 270 s(i,j)=peek(m+j):next:poke211,c-1:printb$(i):m=m+40:next
  19. 280 rem *** convert stored screen codes to printable strings
  20. 290 fori=0toh-1:forj=0tow-1:a=s(i,j):ifa<32ora>95thena=a+64:goto310
  21. 300 ifa>65thenifa<96thena=a+32
  22. 310 c$(i)=c$(i)+chr$(a):next:next
  23. 320 rem *** press 'f1' to rewrite original text
  24. 330 getr$:ifr$<>chr$(133)then330
  25. 340 print"":rem restore original text color
  26. 350 poke214,r-1:print:print"[145]";:rem set row number
  27. 360 fori=0toh-1:poke211,c-1:printc$(i):next
  28. 370 rem return to main program
  29.